package com.liyongjian.page.dal;

import java.util.Date;
import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import com.liyongjian.page.domain.Visit;
import com.liyongjian.page.domain.enumm.RepState;

public interface VisitRepository extends CrudRepository<Visit, Long> {


    @Query("select t from Visit t where t.repState=:repState and t.createdAt<=:date")
    List<Visit> findByRepStateAndCreatedAt(@Param("repState") RepState repState,
            @Param("date") Date date);

}
